import Vue from 'vue'
import App from './App'
import router from './route/route'
import store from './store/store'
import touch from './directives/touch'
Vue.mixin({
  methods:{
    setDocumentTitle(title) {
      document.title = title;
      let ua = navigator.userAgent;
      if (/\bMicroMessenger\/([\d\.]+)/.test(ua) && /ip(hone|od|ad)/i.test(ua)) {
          var i = document.createElement('iframe');
          i.src = '/favicon.ico';
          i.style.display = 'none';
          i.onload = function () {
              setTimeout(function () {
                  i.remove();
              }, 9);
          };
          document.body.appendChild(i);
      }
    }
  }
})

touch(Vue)


new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
